<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模态框</title>
    <style>
        .div1{
            display: none;
            position: absolute;
            left:50%;
            top:50%;
            margin-left:-100px;
            margin-top:-100px;

        }
        .div2{
            width: 200px;
            height: 30px;
            background-color: darkgray;
            /*border: black 2px solid;*/
            text-align: center;
        }
        .div3{
            width: 200px;
            height: 100px;
            background-color: #F3F3F3;
            /*border: black 2px solid;*/
            text-align: center;
            line-height: 80px;
        }
        .div4{
            width: 200px;
            height: 30px;
            background-color: darkgray;
            /*border: black 2px solid;*/
            text-align: center;
        }
    </style>
</head>
<body>
    <button id="btn">点击按钮</button>
    <div id="div_1" class="div1">
        <div id="div_2">
            <div id="div_3">
                <div class="div2">与傻吊二哥聊天</div>
                <div class="div3">我二哥是个月球儿</div>
                <div class="div4">
                    <a href="#" id="close">关闭与傻吊的聊天</a>>
                </div>
            </div>
        </div>
    </div>
    <script src="jquery.min.js"></script>
    <script>


        $("#btn").click(
            function f() {
                $("#div_1").css("display","block")
            }
        )
        $("#close").click(
            function () {
                $("#div_1").css("display","none")
            }
        )
    </script>

</body>
</html>